import createAxios from '/@/utils/axios'
import { useSiteConfig } from '/@/stores/siteConfig'
import { useAdminInfo } from '/@/stores/adminInfo'

const controllerUrl = '/admin/yxerp.Product/'
const skuControllerUrl = '/admin/yxerp.product.Sku/'

export function index(params: anyObj = {}) {
    return createAxios({
        url: controllerUrl + 'index',
        method: 'get',
        params: params,
    })
}

export function add(params: anyObj = {}) {
    return createAxios({
        url: controllerUrl + 'add',
        method: 'post',
        data: params,
    })
}

export function edit(params: anyObj = {}) {
    return createAxios({
        url: controllerUrl + 'edit',
        method: 'post',
        data: params,
    })
}

export function del(params: anyObj = {}) {
    return createAxios({
        url: controllerUrl + 'del',
        method: 'post',
        data: params,
    })
}

export function getSkuList(params: anyObj = {}) {
    return createAxios({
        url: skuControllerUrl + 'index',
        method: 'get',
        params: params,
    })
}

export function addSku(params: anyObj = {}) {
    return createAxios({
        url: skuControllerUrl + 'add',
        method: 'post',
        data: params,
    })
}

export function editSku(params: anyObj = {}) {
    return createAxios({
        url: skuControllerUrl + 'edit',
        method: 'post',
        data: params,
    })
}

export function delSku(params: anyObj = {}) {
    return createAxios({
        url: skuControllerUrl + 'del',
        method: 'post',
        data: params,
    })
}

export function batchAddSkus(params: anyObj = {}) {
    return createAxios({
        url: skuControllerUrl + 'batchAdd',
        method: 'post',
        data: params,
    })
} 